<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <link rel="stylesheet" th:href="@{/css/daohang.css}" />
    <script th:src="@{/layui/layui.all.js}" charset="utf-8"></script>
    <link rel="stylesheet" th:href="@{/layui/layui.css}"  media="all" />
</head>
<body bgcolor="">
<!--轮播图片-->
<div class="layui-carousel" id="test1">
    <div carousel-item="">
        <div><img src="image/lun.jpg" width="100%" height="100%"/></div>
        <div><img src="image/lun2.jpg" width="100%" height="100%"/></div>
        <div><img src="image/13.jpg" width="100%" height="120%"/></div>
    </div>
</div>
<script>
    layui.use('carousel', function () {
        var carousel = layui.carousel;
        //建造实例
        carousel.render({
            elem: '#test1'
            , width: '100%' //设置容器宽度
            , arrow: 'none' //始终显示箭头
            , width: '1080px'
            , height: '150px'
            //,anim: 'updown' //切换动画方式
        });
    });
</script>
<fieldset class="layui-elem-field layui-field-title" >
    <legend><span class="" style="font-size: 14px">
        <a href="/dor/indexdemo">首页<span class="layui-box">&gt;</span></a>
  <span>公告<span class="layui-box">&gt;</span></span>
  <span>发布公告<span class="layui-box">&gt;</span></span>
</span>
    </legend>
</fieldset>


<input th:unless="${session.user eq null}" id="" th:value="${session.user.getName()}" style="display:none"/>

<form class="layui-form" action="/dor/text" method="post">
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">发布人</label>
        <div class="layui-input-inline">
            <input class="layui-input" th:unless="${session.user eq null}" name="name" th:value="${session.user.getName()}"/>
            <input class="layui-input" th:if="${session.user eq null}" name="name"/>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <textarea placeholder="请输入标题" class="layui-textarea" lay-verify="required" required="required" name="title"></textarea>
        </div>
    </div>
<div class="layui-form-item layui-form-text">
    <label class="layui-form-label">公告内容</label>
    <div class="layui-input-block">
        <textarea  placeholder="请输入内容"  class="layui-textarea layui-hide" name="context"  lay-verify="content"  id="LAY_demo_editor" ></textarea>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</div>
</form>
<script th:inline="javascript">
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');
    });
    var flag = [[${flag}]];
    if (flag === 1){
        layer.open({
            content: '发布成功'
        });
    }
</script>
</body>
</html>